cf89d818e96b95df4cd6fb004169d4a2ba5eda0f,controller-client/src/main/java/org/jboss/as/controller/client/helpers/standalone/ServerDeploymentHelper.java,ServerDeploymentHelper,deploy,#String#InputStream#,42
Before Change
DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
builder = builder.add(runtimeName, input).andDeploy();
DeploymentPlan plan = builder.build();
DeploymentAction action = builder.getLastAction();
Future<ServerDeploymentPlanResult> future = deploymentManager.execute(plan);
ServerDeploymentPlanResult planResult = future.get();
actionResult = planResult.getDeploymentActionResult(action.getId());
} catch (Exception ex) {
throw new ServerDeploymentException(ex);
}
After Change
public String deploy(String runtimeName, InputStream input) throws ServerDeploymentException {
ServerDeploymentPlanResult planResult;
List<DeploymentAction> actions = new ArrayList<DeploymentAction>();
try {
DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
AddDeploymentPlanBuilder addBuilder = builder.add(runtimeName, input);
actions.add(addBuilder.getLastAction());
builder = addBuilder.andDeploy();
actions.add(builder.getLastAction());
DeploymentPlan plan = builder.build();
Future<ServerDeploymentPlanResult> future = deploymentManager.execute(plan);
planResult = future.get();
} catch (Exception ex) {
throw new ServerDeploymentException(ex);
}
for (DeploymentAction action : actions) {
ServerDeploymentActionResult actionResult = planResult.getDeploymentActionResult(action.getId());
if (actionResult.getDeploymentException() != null)
throw new ServerDeploymentException(actionResult);
}